<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<html>
<body>
<head>
<link rel="stylesheet" type="text/css"
  href="plug-in/easyui/themes/IconExtension.css">
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
</head>
<body>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="wxTagList" checkbox="true" fitColumns="false" title="用户标签" actionUrl="wxTagController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人名称"  field="createName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人登录名称"  field="createBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人名称"  field="updateName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人登录名称"  field="updateBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新日期"  field="updateDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="所属部门"  field="sysOrgCode"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="所属公司"  field="sysCompanyCode"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="公众号标识"  field="accountId"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="标签名称"  field="name"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="标签标识"  field="tagId"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="粉丝数"  field="userCount"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="备注"  field="remark"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgDelOpt title="删除" url="wxTagController.do?doDel&id={id}" />
   <t:dgToolBar title="录入" icon="icon-add" url="wxTagController.do?goAdd" funname="add" width="100%" height="100%"></t:dgToolBar>
   <t:dgToolBar title="编辑" icon="icon-edit" url="wxTagController.do?goUpdate" funname="update" width="100%" height="100%"></t:dgToolBar>
   <t:dgToolBar title="批量删除"  icon="icon-remove" url="wxTagController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="wxTagController.do?goUpdate" funname="detail" width="100%" height="100%"></t:dgToolBar>
   <t:dgToolBar title="同步" icon="icon-arrow_ns"
        url="wxTagController.do?doSync" funname="sync"></t:dgToolBar>
   <t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
   <t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>
 <script src = "webpage/com/gomore/wechat/module/tag/wxTagList.js"></script>		
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
 			$("#wxTagListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 			$("#wxTagListtb").find("input[name='updateDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'wxTagController.do?upload', "wxTagList");
}

//导出
function ExportXls() {
	JeecgExcelExport("wxTagController.do?exportXls","wxTagList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("wxTagController.do?exportXlsByT","wxTagList");
}

function sync(){
  $.messager.confirm("确认操作", '确认要同步用户标签吗？', function(r) {
    if (r) {
      doSync(id);
    }
  });
}

function doSync() {
  $.ajax({
    url : "wxTagController.do?doSync",
    type : 'post',
    cache : false,
    dataType : 'json',
    success : function(data) {
      if (!data.success) {
        tip('同步失败: ' + data.msg);
      } else {
        tip(data.msg);
        reloadTable();
        $("#" + gname).datagrid('unselectAll');
      }
    }
  });
}
 </script>
 </body>
 </html>